package com.ruoyi.common.utils.ofd;

import java.util.UUID;

public class EssUuIdUtil {

	/**
	 * 生成UUID并掉-，然后取中间8-16位
	 * @return
	 */
	public static String get8DigitUuId(){

		return UUID.randomUUID().toString().replace("-", "").substring(8, 16);

	}

	/**
	 * 生成UUID并去掉-
	 * @return
	 */
	public static String getUuId(){

		return UUID.randomUUID().toString().replace("-", "");

	}
	/**
	 * 用于根据可签署文件类型的值获取可签署文件类型的字符串内容
	 * @param sAuth
	 * @return
	 */
	public static String GetProductInfoFromAuthNumber(String sAuth){

		if(sAuth == null || "".equals(sAuth) || "0".equals(sAuth)){

			return "不限制";

		}else{

			int iAuth = Integer.parseInt(sAuth);
			String sRet = "";
			if((iAuth & 1) != 0)
				sRet = sRet + "OFFICE 全文批注(office annotation)@" ;
			if((iAuth & 2) != 0)
				sRet = sRet + "网页批注(web annotation)@" ;
			if((iAuth & 4) != 0)
				sRet = sRet + "网页签章(ESSWebSign)@" ;
			if((iAuth & 8) != 0)
				sRet = sRet + "WORD签章(ESSWordSign)@" ;
			if((iAuth & 16) != 0)
				sRet = sRet + "EXCEL签章(ESSExcelSign)@" ;
			if((iAuth & 32) != 0)
				sRet = sRet + "PDF签章(ESSPdfSign)@" ;
			if((iAuth & 64) != 0)
				sRet = sRet + "中间件(ESSMidWare)@" ;
			return sRet;

		}

	}

}
